package com.biocar.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.biocar.serializer.TimestampDeserializer;
import com.biocar.serializer.TimestampSerializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;

/**
 * @author DeSen Xu
 * @date 2021-11-22 22:02
 */
@Data
@NoArgsConstructor
@TableName("mediciens")
public class Medicine {

    /**
     * 药品分词id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 药品分词名称
     */
    @TableField
    private String name;

    /**
     * 词频访问量
     */
    @TableField("count_size")
    private String countSize;

    /**
     * 创建时间(前端返回毫秒级别时间戳)
     */
    @TableField("created_at")
    @JsonDeserialize(using = TimestampDeserializer.class)
    @JsonSerialize(using = TimestampSerializer.class)
    private Timestamp createdAt;
}
